package com._520it.crm.service.impl;

import com._520it.crm.domain.Vehicle;
import com._520it.crm.mapper.VehicleMapper;
import com._520it.crm.service.IVehicleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/5/13.
 */
@Service
public class VehicleServiceImpl implements IVehicleService {
    private final VehicleMapper mapper;

    @Autowired
    public VehicleServiceImpl(VehicleMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public int deleteByPrimaryKey(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Vehicle record) {
        return mapper.insert(record);
    }

    @Override
    public Vehicle selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Vehicle> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(Vehicle record) {
        return mapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Vehicle> selectPage(int current, int size, String name, String vehicleModel, String classify, Integer busload, String carrying, String carPrice) {
        return mapper.selectPage(current,size,name,vehicleModel,classify,busload,carrying,carPrice);
    }


    @Override
    public int selectPageCount(int current, int size, String name, String vehicleModel, String classify, Integer busload, String carrying, String carPrice) {
        return mapper.selectPageCount(current,size,name,vehicleModel,classify,busload,carrying,carPrice);
    }
}
